home *** CD-ROM | disk | FTP | other *** search
/ PC Media 7 / PC MEDIA CD07.iso / share / prog / ooav3 / ooavtest.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-05-22  |  1.0 KB  |  39 lines

  1. uses      OOAV,Dos;
  2.  
  3. var       a:PArchive;
  4.           sr:SearchRec;
  5.           DT:DateTime;
  6.  
  7. begin
  8.   writeln('avail: ',memavail);
  9.  
  10.   { It's not necessary that you call IdentifyArchive,
  11.     but it's easy for checking when you've add new archive-types }
  12.   case IdentifyArchive(paramstr(1)) of
  13.     '?': writeln('Cannot open/identify current archive');
  14.     'Z': writeln('It''s a ZIP-archive');
  15.     'A': writeln('It''s an ARJ-archive');
  16.     'L': writeln('It''s an LZH-archive');
  17.     'C': writeln('It''s an ARC-archive');
  18.     'O': writeln('It''s a ZOO-archive');
  19.   end;
  20.  
  21.   a:=New(PArchive,Init);
  22.   if not a^.Name(paramstr(1)) then
  23.   begin
  24.     writeln('Cannot open file');
  25.     exit;
  26.   end;
  27.   writeln('Name':15,'Size':10,'Date':10,'Time':12);
  28.   a^.FindFirst(sr);
  29.   while sr.Name<>'' do
  30.   begin
  31.     write  (sr.Name:15,sr.Size:10);
  32.     UnpackTime(sr.Time,DT);
  33.     writeln(dt.day:10,dt.month:3,dt.year:5,dt.hour:4,dt.min:3,dt.sec:3);
  34.     a^.FindNext(sr);
  35.   end;
  36.   Dispose(A,Done);
  37.   writeln('End');
  38.   writeln('avail: ',memavail);
  39. end.